library(tidyverse)
library(data.table)
PX = c(18,20,22,46,48,50,52,54,60,70,80)

for(p in PX){
  files = str_c("../",p)
  
  file_names = fs::dir_ls(files,regexp = "txt$")
  result = read_table(file_names,show_col_types = F,col_names = F) %>% 
    set_names(c("基因位点","突变数量"))
  
  genemat = read_table(str_c("../genemat_",p,".txt"),show_col_types = F,col_names = F) %>% 
    mutate(
      sums = rowSums(.),
      "基因位点" = 1:n()
      ) 
  
  v = left_join(result,genemat,by = "基因位点") %>% 
    head(30) %>% as.data.table()
  print(str_c("基因概率为:",p))
  print(v,max_extra_cols = 30)
}



